/**
 * @brief   : 稳态热传导分析流程
 * @version : 0.1
 * @author  : wanghuan
 * @date    : 2024.10.26
 * @copyright Copyright (c) 2024 by 神工仿真, All Rights Reserved.
 */

#pragma once
#include <set>
#include "Utility/Algebra/LinearSolver.h"
#include "DataStructure/Common/Out.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Common/Id.h"
#include "DataStructure/Input/Solver/Subcase.h"
#include "DataStructure/Input/Solver/Project.h"
#include "DBManager/DBServiceFactory.h"
#include "../Common/TaskExport.h"
#include "SGFem/Task/Kernel/MModel.h"

/**
 * @brief   : 稳态热传导计算
 * @author  : wanghuan
 * @date    : 2024.10.26
 */
class Task_DECLSPEC ThermalSolver
{
public:

/*计算一组约束相同的工况的刚度矩阵 */
// static SG::DataStructure::Common::Status CalcMatrixEquation (const SG::DBManager::DBServiceFactorySP dbServiceFactory, const SG::DataStructure::FEM::Subcase& subcase, const std::set<SG::DataStructure::Common::Id>& loadCases);

/**
 * @brief    计算指定工况的结果
 * 
 * @param       dbServiceFactory  数据库
 * @param       loadId            载荷集（右端项）标识
 * @param[out]    temperature     温度结果
 */
static void Solve (const Kernel::MModel& model, const SG::DataStructure::Common::Id loadId, _OUT std::vector<SG::DataStructure::Common::Real>& temperature);

/** 稳态热传导计算*/
static void Solve (const SG::DBManager::DBServiceFactorySP dbServiceFactory, const SG::DataStructure::FEM::Project&project, const SG::DataStructure::Common::IdArray& ids);

private:

  static std::shared_ptr<SG::Algebra::LinearSolver> s_solver;
};